import type { VbenFormSchema } from '#/adapter/form'
import { pushRoleTypeOptions } from '#/config/options/system'
import { $t } from '@vben/locales'

export function getAddEditFormSchema() {
    return [
        {
            fieldName: 'name',
            label: $t('page.system.children.messageTemplat.children.form.templateName'),
            defaultValue: '',
            component: 'Input',
            rules: 'required',
            formItemClass: 'col-span-1 md:col-span-2'
        },
        {
            fieldName: 'receiverType',
            label: $t('page.system.children.messageTemplat.children.form.pushRole'),
            defaultValue: '',
            component: 'Select',
            rules: 'required',
            formItemClass: 'col-span-1 md:col-span-2',
            componentProps: {
                options: pushRoleTypeOptions
            }
        },
        {
            fieldName: 'title',
            label: $t('page.system.children.messageTemplat.children.form.title'),
            defaultValue: '',
            component: 'Input',
            rules: 'required',
            formItemClass: 'col-span-1 md:col-span-2'
        },
        {
            fieldName: 'content',
            label: $t('page.system.children.messageTemplat.children.form.content'),
            defaultValue: '',
            component: 'Textarea',
            rules: 'required',
            formItemClass: 'col-span-1 md:col-span-2'
        },
        {
            fieldName: 'status',
            label: $t('page.system.children.messageTemplat.children.form.templateStatus'),
            defaultValue: '',
            component: 'Switch',
            rules: 'required',
            formItemClass: 'col-span-1 md:col-span-2',
            componentProps: {
                checkedValue: 1,
                unCheckedValue: 0,
                checkedChildren: $t('options.templateStatus.children.enabled'),
                unCheckedChildren: $t('options.templateStatus.children.disabled')
            }
        }
    ] as VbenFormSchema[]
}
